package cc.messcat.entity.helpUnits;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import cc.messcat.entity.fupin.PoorVillage;
import cc.messcat.entity.helpPerson.HelpPerson;
import cc.messcat.entity.system.Role;

/**
 * 角色等级
 * @author John
 * 帮扶单位
 */
@Entity
@Table(name = "HELPUNITS")
public class HelpUnits implements Serializable{
	
	private static final long serialVersionUID = -892686837316266362L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Long id;
	
	@Column(name = "date")
	private Date date;//日期
	
	@Column(name = "province")
	private String province;//所在省
	
	@Column(name = "city")
	private String city;//所在市
	
	@Column(name = "county")
	private String county;//所在县
	
	@Column(name = "country")
	private String country;//所在乡
	
	@Column(name = "Unit_name")
	private String Unit_name;//单位名称
	
	@Column(name = "Unit_type")
	private String Unit_type;//单位类型
	
	@Column(name = "Affiliation")
	private String Affiliation;//隶属关系
	
	@Column(name = "work_telephone")
	private String work_telephone;//单位电话
	
	@Column(name = "Contacts")
	private String Contacts;//联系人
	
	@Column(name = "Contact_phone")
	private String Contact_phone;//联系人电话
	
	@Column(name = "Unit_address")
	private String Unit_address;//单位地址
	
	@Column(name = "Postal_Code")
	private String Postal_Code;//邮政编码
	
	@Column(name = "Mail_box")
	private String Mail_box;//电子邮箱
	
	@Column(name = "One_man")
	private String One_man;//制单人
	
	@Column(name = "Card_time")
	private Date Card_time;//制单时间
	
	@Column(name = "Modifier")
	private String Modifier;//修改人
	
	@Column(name = "update_time")
	private Date update_time;//修改时间
	
	@Column(name = "Unit_id")
	private Long Unit_id;//单位编号
	
	@Column(name = "is_del")
	private String isDel;//删除 0  删除 1 正常
	
	@ManyToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
    @JoinTable(name = "helpUnits_AND_PoorVillage",
            joinColumns = {@JoinColumn(name = "helpUnitsId")},
            inverseJoinColumns = {@JoinColumn(name = "PoorVillageId")})
	private List<PoorVillage> poorVillages;
	

	@OneToMany
	@JoinColumn(name="HELP_UNIT")
	private List<HelpPerson> helpPerson;
	
	@Column(name = "AREACODES")
    private String areaCodes;//行政编号
	
//    @Column(name = "ANNUAL")
//    private String annual;//年度


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public List<HelpPerson> getHelpPerson() {
		return helpPerson;
	}

	public void setHelpPerson(List<HelpPerson> helpPerson) {
		this.helpPerson = helpPerson;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getUnit_name() {
		return Unit_name;
	}

	public void setUnit_name(String unit_name) {
		Unit_name = unit_name;
	}

	public String getUnit_type() {
		return Unit_type;
	}

	public void setUnit_type(String unit_type) {
		Unit_type = unit_type;
	}

	public String getAffiliation() {
		return Affiliation;
	}

	public void setAffiliation(String affiliation) {
		Affiliation = affiliation;
	}

	public String getWork_telephone() {
		return work_telephone;
	}

	public void setWork_telephone(String work_telephone) {
		this.work_telephone = work_telephone;
	}

	public String getContacts() {
		return Contacts;
	}

	public void setContacts(String contacts) {
		Contacts = contacts;
	}

	public String getContact_phone() {
		return Contact_phone;
	}

	public void setContact_phone(String contact_phone) {
		Contact_phone = contact_phone;
	}

	public String getUnit_address() {
		return Unit_address;
	}

	public void setUnit_address(String unit_address) {
		Unit_address = unit_address;
	}

	public String getPostal_Code() {
		return Postal_Code;
	}

	public void setPostal_Code(String postal_Code) {
		Postal_Code = postal_Code;
	}

	public String getMail_box() {
		return Mail_box;
	}

	public void setMail_box(String mail_box) {
		Mail_box = mail_box;
	}

	public String getOne_man() {
		return One_man;
	}

	public void setOne_man(String one_man) {
		One_man = one_man;
	}

	public Date getCard_time() {
		return Card_time;
	}

	public void setCard_time(Date card_time) {
		Card_time = card_time;
	}

	public String getModifier() {
		return Modifier;
	}

	public void setModifier(String modifier) {
		Modifier = modifier;
	}

	public Date getUpdate_time() {
		return update_time;
	}

	public void setUpdate_time(Date update_time) {
		this.update_time = update_time;
	}

	public Long getUnit_id() {
		return Unit_id;
	}

	public void setUnit_id(Long unit_id) {
		Unit_id = unit_id;
	}

	public List<PoorVillage> getPoorVillages() {
		return poorVillages;
	}

	public void setPoorVillages(List<PoorVillage> poorVillages) {
		this.poorVillages = poorVillages;
	}

	public String getIsDel() {
		return isDel;
	}

	public void setIsDel(String isDel) {
		this.isDel = isDel;
	}

	public String getAreaCodes() {
		return areaCodes;
	}

	public void setAreaCodes(String areaCodes) {
		this.areaCodes = areaCodes;
	}

}
